package hashtable;

import org.junit.jupiter.api.Assumptions;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;

import java.util.HashMap;
import java.util.Map;

import static org.junit.jupiter.api.Assertions.assertEquals;

/**
 * <h2>LongestSubstring</h2>
 * <p>Description</p>
 * <p>CreatedAt: 2020-01-13 22:23</p>
 * <p><a href="mailto:forever2y_y@163.com">SendMailToMe</a></p>
 *
 * @author llh
 */
public class LongestSubstring {

    private Map<String, Integer> qa = new HashMap<>();

    @BeforeEach
    public void setQa() {
        qa.put("abcabcbb", 3);
        qa.put("bbbbb", 1);
        qa.put("pwwkew", 3);
    }


    @Test
    public void test01() {
        qa.forEach((k, v) -> assertEquals(v, new LengthOfLongestSubstring().solutionBasic(k), "error on " + k));
    }
    @Test
    public void test02() {
        qa.forEach((k, v) -> assertEquals(v, new LengthOfLongestSubstring().solutionSlidingWindow(k), "error on " + k));
    }
    @Test
    public void test03(){
        qa.forEach((k, v) -> assertEquals(v, new LengthOfLongestSubstring().solutionSlidingWindowIm(k), "error on " + k));
    }
}
